<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        // var age = prompt('请输入你的年龄');
        // var str = '我今年已经' + age + '岁了';
        // alert(str);


        let age = prompt('请输入：你出生日期？');
        console.log(age);
        let year = 2022 - age;
        alert('今年你' + year + '岁啦');


        // console.log(true + 1);
        // console.log(false + 1);


        // let year = prompt('请输入第一个值');
        // let num = prompt('请输入第二个值');
        // let age = parseFloat(year) + parseFloat(num);
        // alert('您的结果是' + age)
    </script>
</body>

</html>